// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init()
const db = cloud.database();
// 云函数入口函数
exports.main = async (event, context) => {

  let result = 'fail'
  //----------------------更新设置表
  let addNewSettings = await db.collection('data').doc('5c6d16f447882f40e4dcded2').update({
    data: {
      optionsInfo: event.optionsInfo,
      productInfo: event.productInfo
    }
  }).then(res => {
    result = 'success'
  })
  return {
    result: result
  }
}